package com.gph.saviorframework.wf.dao;

import com.gph.saviorframework.wf.model.ProcessResult;
import org.apache.ibatis.annotations.Param;
import org.aspectj.lang.annotation.Aspect;

import java.util.List;

/**
 * 流程审批结果dao
 */
@Aspect
public interface ProcessResultDao {

    /**
     * 保存审批结果
     * @param processResult
     */
    void save(ProcessResult processResult);

    /**
     * 根据流程实例编号和审批编号删除
     * @param processInsId
     * @param applyId
     */
    void delete(@Param(value = "processInsId")String processInsId,
                @Param(value = "applyId")String applyId);

    /**
     * 更新
     */
    void update(ProcessResult processResult);

    /**
     * 根据流程实例编号和审批编号获取processresult
     * @param processInsId
     * @param applyId
     * @return
     */
    ProcessResult get(@Param(value = "processInsId")String processInsId,
                      @Param(value = "applyId")String applyId);

    /**
     * 根据审批编号获取processresult
     * @param applyId
     * @return
     */
    ProcessResult getByApplyId(@Param(value = "applyId")String applyId);

    /**
     * 根据审批类型获取
     * @param applyType
     * @return
     */
    List<ProcessResult> getByType(@Param(value = "applyType")String applyType);

    /**
     * 批量删除
     * @param ids
     */
    void batchDelete(List<ProcessResult> ids);
}
